package cn.fl.capital.service;

import java.util.List;

import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.capital.condition.CapPayInfoQueryCondition;
import cn.fl.capital.vo.CapPayInfoVO;
import cn.fl.capital.vo.CapPayLeaseVO;
import cn.fl.capital.vo.CapPayMaterialVo;
import cn.fl.capital.vo.CapPayeeInfoVO;
import cn.fl.export.condition.CapPayInfoExportCondition;
import cn.fl.fileconfig.condition.FileCfgConditonQC;
import cn.fl.project.vo.PrjBscInfoVO;
import cn.fl.project.vo.PrjFileInfoVO;
import fl.flow.facade.flow.dto.FlowCompleteParamsDTO;

/**
 * @Description: 付款信息表 客户端服务层接口
 * 业务层方法名称前缀：
 * 新增：add*
 * 删除：remove*
 * 修改：modify*
 * 批量：batch*
 * 查询对象：select* get*
 * 查询集合：search*
 */
public interface ICapPayInfoService {
	
	/**
	 * 城配信审审核付款 - 点击生成付款信息/付款信息对应流程历史/修改付款信息审核状态为:放款中
	 * @param flowCompleteParamsDTO
	 * @return
	 * @throws BaseException
	 */
	public boolean addCapPayInfoAndFlowSH(FlowCompleteParamsDTO flowCompleteParamsDTO)throws BaseException;
	
	/**
	 * 城配取消单个支付表付款
	 * 		修改付款信息:付款状态:未申请  付款类型:特殊放款
	 * 		修改付款关联流程记录信息:status=0 
	 * @param capPayId
	 * @return
	 * @throws BaseException
	 */
	public boolean modifyCapSysFlowSH(Long capPayId, String processInstanceId)throws BaseException;
	
	/**
	 * 必要参数:业务数据主键
	 * @param flowStartParamsDTO 启动参数
	 */
	//public DataResultDTO addFlowStart(FlowStartParamsDTO flowStartParamsDTO)throws BaseException;
	
	/**
	 * 获取唯一对象
	 * @param id 主键
	 * @return 对象DTO
	 */
	public CapPayInfoVO selectById(Long id) throws BaseException;
	
	/**
	 * 新增
	 * @param entity
	 * @return
	 */
    public Long add(CapPayInfoVO entity) throws BaseException;
    
    /**
     * 批量删除
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids) throws BaseException;

    /**
     * 修改
     * @param entity
     * @return
     */
    public boolean modify(CapPayInfoVO entity) throws BaseException;

	/***********************************
	 * 付款申请
	 * @param entity
	 * @return
	 * @throws BaseException
	 ************************************/
	public DataResultVO payApply(CapPayInfoVO entity) throws BaseException;
	
	/***********************************
	 * 付款申请  17-8-9 by YAOXXIURONG
	 * @param entity
	 * @return
	 * @throws BaseException
	 ************************************/
	public DataResultVO payApplyV2(DataResultVO result, CapPayInfoVO entity, String procDefKey) throws BaseException;

    /**
     * 分页查询所有
     * @param page
     * @return
     */
    public Pager searchListPage(Pager page) throws BaseException;
    
    /**
     * 根据条件查询所有
     * @param condition
     * @return
     */
    public List<CapPayInfoVO> searchList(CapPayInfoQueryCondition condition) throws BaseException;


	/**
	 * 付款状态
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getPayStsCdList() throws BaseException;
	
	/**
	 * 申请来源
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getApplyResCdList() throws BaseException;

	/**
	 * 首期款代收状态
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getFstColCdList() throws BaseException;

    /**
     * 收款方类型
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> getPayeeTypCdList() throws BaseException;

    /**
     * 款项
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> getFundTypCdList() throws BaseException;
    /**
     * 付款方式
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> getPayWayCdList() throws BaseException;
	/**
	 * 银行账号类型
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getBkAccTypCdList() throws BaseException;



    /**
     * 查询付款信息中租赁物数量、历史付款次数、上传资料数量
     * @param vo
     * @return
     */
    public CapPayInfoVO getPayInfoCount(CapPayInfoVO vo) throws BaseException;

    /**
     * 初始化付款租赁物列表
     * @param condition
     * @return
     */
    public List<CapPayLeaseVO> searchLeaseList(CapPayInfoQueryCondition condition) throws BaseException;

    /**
     * 查询历史付款记录
     * @param condition
     * @return
     * @throws BaseException
     */
    public List<CapPayeeInfoVO> searchHisList(CapPayInfoQueryCondition condition) throws BaseException;

    /**
     * 查询上传资料记录
     * @param condition
     * @return
     * @throws BaseException
     */
    public List<CapPayMaterialVo> searchMateList(CapPayInfoQueryCondition condition) throws BaseException;
    
    /**
     * 查询是否下拉框数据
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> searchYesOrNOList()throws BaseException;
    
    /**
     * 查询三方业务处理意见下拉框数据
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> searchOrgBizOpnCdList()throws BaseException;
    
    /**
     * 查询是否团单下拉框数据
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> searchIsGrpList()throws BaseException;

	/**
	 * 修改放款资料的验证状态
	 * @param fileId
	 * @param audStsCd
	 * @return
	 * @throws BaseException
	 */
	public boolean modifyMateStsCd(Long fileId,String audStsCd) throws BaseException;

	/**
	 * 删除放款资料
	 * @param fileId
	 * @return
	 * @throws BaseException
	 */
	public boolean removeMate(Long fileId) throws BaseException;

	/**
	 * 查询上传资料数量
	 * @param id 项目产品明细ID
	 * @param orgCd 机构代码
	 * @return 资料数量-已上传数量
	 */
	public String getPayMateCnt(String id,String orgCd) throws BaseException;

    /**
     * 导出付款列表
     * @param condition
     * @return
     * @throws BaseException
     */
	public DataResultVO exportPayList(CapPayInfoExportCondition condition) throws BaseException;

	/**
	 * 校验附件《所有权转让协议首页》是否上传，若未上传不可通过该流程
	 * @param prjId
	 * @param prjPrdDtlId
	 * @return
	 * @throws BaseException
	 */
	DataResultVO checkTransfeOfTitle(Long prjId, Long prjPrdDtlId) throws BaseException;

	/**
	 * @MethodName searchMateFileList
	 * @Description: 获取租赁物信息
	 * @Author: wangpengtao@lionbridgecapital.cn
	 * @CreateDate: 2019/6/21 11:52
	 * @Version: V1.0.0
	 * @Param condition
	 * @Param qc
	 * @Return java.util.List<cn.fl.capital.vo.CapPayMaterialVo>
	 * @UpdateRemark [序号][YYYY-MM-DD] [更改人姓名][变更描述]
	 */
	public List<PrjFileInfoVO> searchMateFileList(CapPayInfoQueryCondition condition, FileCfgConditonQC fileQc) throws BaseException;
	
	/**
	    * 放款流程发起成功-同步修改项目产品基础信息中的付款账号
	 * @param entity
	 * @return
	 * @throws BaseException
	 */
	public boolean updateSplAccNoId(CapPayInfoVO entity) throws BaseException;

	/**
	 * 分页查询所有初始化车抵贷（YQ）手动扣款列表
	 * @param page
	 * @return
	 */
	public Pager searchCddYqCutPayListPage(Pager page) throws BaseException;

	/**
	 * 抵贷（YQ）确认扣款
	 * @param
	 * @return
	 */
	public DataResultDTO confirmCutPay(String payId, String cstId, String cutPaySchNo, String paySchId, String paySchNo) throws BaseException;

	/**
	 * 分页查询所有初始化车抵贷（YQ）手动扣款（扣款失败）列表
	 * @param page
	 * @return
	 */
	public Pager searchCddYqCutPayFailListPage(Pager page) throws BaseException;

	/**
	 * 车抵贷（YQ）刷新扣款状态
	 * @param
	 * @return
	 */
	public DataResultDTO refreshCutPayStsCd(String cutPaySchNo, String paySchNo, String cstId);

	/**
	 * 获取是否安装GPS信息
	 * @param
	 * @return
	 */
	Object getGPSFlag(PrjBscInfoVO prjBscInfoVO) throws BaseException;

	/**
	 * 获取挂靠公司名下车辆抵押信息
	 * @param
	 * @return
	 */
	Integer getNoPassAudCarNum(PrjBscInfoVO prjBscInfoVO) throws BaseException;

	/**
	 * 获取供应商名下车辆抵押信息
	 * @param
	 * @return
	 */
	Integer getNoSplPassNum(Long splId) throws BaseException;

	/**
	 * 分页查询放款录单管理列表
	 * @param page
	 * @return
	 */
	Pager searchPayRecListPage(Pager page) throws BaseException;


	/**
	 * 根据启用支付表号查询付款表信息
	 * @param paySchId
	 * @return
	 * @throws BaseException
	 */
	List<CapPayInfoVO> selectListByEnabledPaySchId(Long paySchId) throws BaseException;

	/**
	 * 轻卡小程序作废放款流程通过付款id修改项目状态
	 * @param capPayId
	 * @throws BaseException
	 */
	void modifyPrjBscInfoForLcvCancel(Long capPayId) throws BaseException;
}
